import service from "@/utils/service";

// 通过条件分页查询商品类别列表
export function getCategories(data: any) {
    return service({
        url: "/categories/vo/list",
        method: "POST",
        data
    })
}

// 根据id查询商品类别基本信息
export function getCategoriesById(id: String) {
    return service({
        url: "/categories/vo/list?categoryId=" + id,
        method: "POST",
    })
}

// 通过条件分页查询APP商品列表
export function getProduct(data: any) {
    return service({
        url: "/product/app/page",
        method: "POST",
        data
    })
}

// 根据id查询商品详情信息
export function getProductById(id: String) {
    return service({
        url: "/product/app/detail?productId=" + id,
        method: "POST",
    })
}

// 修改商品
export function editProduct(data: any) {
    return service({
        url: "/product/app/edit",
        method: "POST",
        data
    })
}

// 删除商品
export function deleteProductById(id: any) {
    return service({
        url: "/product/" + id,
        method: "DELETE",
    })
}